///////////////////////////////////////////////////////////////////////////////
// File:        Console.hpp
// Author:      671643387@qq.com
// Description:
///////////////////////////////////////////////////////////////////////////////

#ifndef SHARED_CONSOLE_HPP_
#define SHARED_CONSOLE_HPP_

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif

#if defined(__WINDOWS__)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif

///////////////////////////////////////////////////////////////////////////////
class Console
{
public:
    ///////////////////////////////////////////////////////////////////////////
#if defined(__WINDOWS__)
    const static int foreground_WHITE = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED;
    const static int foreground_BLACK = 0;
    const static int foreground_RED = FOREGROUND_RED;
    const static int foreground_GREEN = FOREGROUND_GREEN;
    const static int foreground_BLUE = FOREGROUND_BLUE;
    const static int foreground_INTENSITY = FOREGROUND_INTENSITY;
    const static int background_WHITE = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE;
    const static int background_BLACK = 0;
    const static int background_RED = BACKGROUND_RED;
    const static int background_GREEN = BACKGROUND_GREEN;
    const static int background_BLUE = BACKGROUND_BLUE;
    const static int background_INTENSITY = BACKGROUND_INTENSITY;
#endif

public:
    ///////////////////////////////////////////////////////////////////////////
    static void GetCursorPos(int&x, int &y);
    static void SetCursorPos(int x, int y);
    static void SetColors(int f, int b);
    static void SetDefaultColors(void);
};

#endif /* SHARED_CONSOLE_HPP_ */
